
function zapolni(){
    $.ajax({
        url: 'vsebina.xml',
        success: function(xml) {
			var i = 0;
            $(xml).find('content').each(function(){
                var artist = $(this).find('artist').text();
				var album = $(this).find('album').text();
				var image = $(this).find('image').text();
				var price = $(this).find('price').text();
				var description = $(this).find('description').text();
								
				if (i%2!=0)				
					$('#content').append('<div class="cnt"><div class="product"><img src="'+image+'" class="productpic" alt="'+artist+'" />'+
					'<div class="description">'+
					'<h4>'+artist+'</h4><br/>'+
					'<h5>'+ album+'</h5><br/>'+
					'<p>'+description+'</p>'+
					'<h3>'+price+'</h3><a href="#"><div class="ply"><img src="play2.png" class="playit2" alt="play" /></div></a>'+
					'<a href="#"><div class="ply"><img src="buyitnovo.jpg" class="buyit" alt="buy it" /></div></a>'+
					'</div></div></div>');
				else
					$('#content').append('<div class="cnt"><div class="product2"><img src="'+image+'" class="productpic" alt="'+artist+'" />'+
					'<div class="description">'+
					'<h4>'+artist+'</h4><br/>'+
					'<h5>'+ album+'</h5><br/>'+
					'<p>'+description+'</p>'+
					'<h3>'+price+'</h3><a href="#"><div class="ply"><img src="play1.png" class="playit1" alt="play" /></div></a>'+
					'<a href="#"><div class="ply"><img src="buyitnovo.jpg" class="buyit" alt="buy it" /></div></a>'+
					'</div></div></div>');
				i++;
								
            });
        }
    });
};

zapolni();



